home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-2.iso
/
extra_2
/
flmgmtcl.zip
/
DIRLIST.H
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-02
|
4KB
|
135 lines
// ==========================================================================
// Class Specification : CDirList
// ==========================================================================
// Header file : dirlist.h
// Source : Periphere NV (R.Mortelmans)
// Creation Date : 2nd November 1995
// Last Modification : 2nd November 1995
// //////////////////////////////////////////////////////////////////////////
// Properties:
// NO Abstract class (does not have any objects)
// YES Derived from CObject
// NO Is a Cwnd.
// NO Two stage creation (constructor & Create())
// NO Has a message map
// NO Needs a resource (template)
// NO Persistent objects (saveable on disk)
// NO Uses exceptions
// //////////////////////////////////////////////////////////////////////////
// Desciption :
// This class is used to get a list of all the directories in a
// certain path.
// You first set the path, by specifying it (SetPath())
// Then you start the search (Search())
// And then you examine the result (GetList())
// Remark:
// ***
// Prerequisites (necessary conditions):
// ***
/////////////////////////////////////////////////////////////////////////////
#ifndef __DIRLIST_H__
#define __DIRLIST_H__
#include "path.h"
class CDirList : public CObject
{
DECLARE_DYNAMIC(CDirList)
// Data members -------------------------------------------------------------
public:
protected:
CPathSpec m_path;
CObArray m_dirArray;
private:
// Member functions ---------------------------------------------------------
public:
CDirList();
// --- In :
// --- Out :
// --- Returns :
// --- Effect : Contructor of object
// It will initialize the internal state
CPathSpec GetPath() const;
// --- In :
// --- Out :
// --- Returns : The path of dirlist
// --- Effect :
BOOL SetPath(CPathSpec path);
// --- In : path : The new path specification of the dirlist
// --- Out :
// --- Returns : Whether the setting succeeded or not
// --- Effect : The specified path is converted to an absolute path
// if it is relative
// When no file specification is supplied *.* is assumed
BOOL Search();
// --- In :
// --- Out :
// --- Returns : Whether the search succeeded or not
// --- Effect : This function will search the directory specified
// by SetPath and build a list of dir specifications
// All the found dirs are appended to the list
// These can be accessed by GetList
const CObArray* GetList() const;
// --- In :
// --- Out :
// --- Returns : A const pointer to the list of const dir specifications
// --- Effect : The list may be empty, when search did not find any dirs
const CDirSpec* GetAt(int nIndex) const;
// --- In :
// --- Out :
// --- Returns :
// --- Effect :
void Sort();
// --- In :
// --- Out :
// --- Returns :
// --- Effect : Sorts the Dir list
void ClearList();
// --- In :
// --- Out :
// --- Returns :
// --- Effect : Clears the dir list
#ifdef _DEBUG
virtual void Dump(CDumpContext&) const;
virtual void AssertValid() const;
#endif //_DEBUG
virtual ~CDirList();
// --- In :
// --- Out :
// --- Returns :
// --- Effect : Destructor of object
protected:
private:
// Message handlers ---------------------------------------------------------
};
#endif
// ==========================================================================